/**
 * Copyright (c) Daniel Centore
 *
 * ex: set filetype=java expandtab tabstop=4 shiftwidth=4 :
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * This code is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation.
 */
package ronp.anim.gui.tools.other;

import java.awt.image.BufferedImage;

import ronp.anim.data.filmstrip.Animation;
import ronp.anim.data.filmstrip.Layer;
import ronp.anim.gui.SelectedState;
import ronp.anim.gui.tools.Tool;
import ronp.anim.gui.viewer.AnimViewer;

/**
 * Selects active grip
 * 
 * @author Daniel Centore
 *
 */
public class GripPicker extends Tool
{
	@SuppressWarnings("unused")
	private AnimViewer viewer;
	private Animation anim;
	private SelectedState state;

	public GripPicker(AnimViewer viewer, Animation anim, SelectedState state)
	{
		this.viewer = viewer;
		this.anim = anim;
		this.state = state;
	}

	@Override
	public void mousePressed(int x, int y)
	{
		// unused
	}

	@Override
	public void mouseReleased(int x, int y)
	{
		state.setActiveLayer(null);
		anim.repaint();
	}

	@Override
	public void gripSelected(Layer l, int x, int y)
	{
		state.setActiveLayer(l);
		anim.repaint();
	}

	@Override
	public BufferedImage getOverlay(int x, int y)
	{
		return null;
	}

}
